#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include "rngs.h"

#define SEED_CEILING 10 //Arbitrary

int main(int argc, char **argv)
{
	int i, j, temp_card, return_val;
	int flag = 0;
	int player_count;

	struct gameState state;
	int k[10] = {village, outpost, steward, smithy, adventurer, council_room, gardens, sea_hag, salvager, baron};
	
	//case village: +1 card, +2 actions
	int test_card = smithy;
	int choice1 = -1;
	int choice2 = -1;
	int choice3 = -1;
	int handPos = -1;
	int *myBonus = 0;
	
	
	for(i = 0; i < MAX_PLAYERS; i++)
	{
		for(j = 1; j < SEED_CEILING; j++)
		{
			player_count = i + 2;
			initializeGame(player_count, k, j, &state);
			
			//printf("Yo %d %d\n", i, j);
			
			temp_card = state.handCount[i];
			
			return_val = cardEffect(test_card, choice1, choice2, choice3, &state, handPos, myBonus);
			
			if(return_val == -1)
			{
				printf("Cardtest4: smithy returned -1 for player %d on seed %d\n", i, j);
				flag++;
			} else if (return_val == 0){
				
				if(state.handCount[i] != temp_card + 2) //-1 to play, +3 from effect; net +2
				{
					printf("Cardtest4: did not work properly for player %d on seed %d\n", i, j);
					flag++;
				}
				
			} else {
				printf("Cardtest4: Unexpected return value for player %d on seed %d\n", i, j);
				flag++;
			}
			
		
		}
	}
	
	printf("Cardtest4: outpost returned %d error(s).\n", flag);
	
	return 0;

}